{extend name="base"}
{block name="title"}游戏房间播放码{/block}
{block name="head"}
<script>
$(function () {
  $('td a.input').click(function () {
    var tr = $(this).parents('tr');
    var code = $('td:eq(3)', tr).text();
    var turn = $(this).text();
    console.log({code: code, turn: turn});

    var html = '<select name="turn">';
    for (var i = 1; i <= turn; i++) {
      var eax = i + '';
      eax = eax.length < 2 ? '0' + eax : eax;
      html += '<option value="' + code + '' + eax + '">第' + eax + '局</option>';
    }
    html += '</select>'

    var url = "http://h6.szmj.pay57.com/?code=o-yqAvxS4Shxmfyz3-lcIRettm-w&query=playback_code=";
    dialog({
      title: '录像回放[' + code + '][' + turn + ']',
      url: url + code + '01',
      width: 960,
      height: 640,
      statusbar: html,
      okValue: '播放',
      ok: function () {
        var a = $(this.node);
        var f = $('iframe', a);
        var v = $('select[name=turn]', a).val();
        f.attr('src', url + v);
        return false;
      }
    }).showModal();
    
  });
});
</script>
{/block}
{block name="body"}
<body class="mainbody">
<form>
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
  <a href="{:url('index/home')}" class="home"><i class="iconfont icon-home"></i><span>首页</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <span>游戏房间播放码</span>
</div>
<!--/导航栏-->

<!--工具栏-->
<div id="floatHead" class="toolbar-wrap">
  <div class="toolbar">
    <div class="box-wrap">
      <a class="menu-btn"><i class="iconfont icon-more"></i></a>
      <div class="l-list">
        <div class="menu-list">
          <input type="text" class="input rule-date-input" id="time1" autocomplete="off" {literal}onclick="WdatePicker({maxDate:'#F{$dp.$D(\'time2\')}'})"{/literal} name="time1" value="{$time1|default=''|substr=0,10}" /> -
          <input type="text" class="input rule-date-input" id="time2" autocomplete="off" {literal}onclick="WdatePicker({minDate:'#F{$dp.$D(\'time1\')}', maxDate:'%y-%M-%d'})"{/literal} name="time2" value="{$time2|default=''|substr=0,10}" />
          <div class="rule-single-select">
            <select name="kind" style="display:none">
              <option value="-1">===所有游戏===</option>
              {foreach name="GAME_KIND" item="v"}
              <option value="{$key}"{eq name="kind" value="$key"} selected{/eq}>[{$key}]{$v}</option>
              {/foreach}
            </select>
          </div>
          <input type="text" class="keyword" autocomplete="off" name="search" value="{$search|default=''|htmlentities}" placeholder="房间号/播放码" />
          <a class="btn-search"><i class="iconfont icon-search"></i></a>
        </div>
      </div>
    </div>
  </div>
</div>
<!--/工具栏-->

<!--列表-->
<div class="table-container">
<table class="ltable border-table">
  <tr>
    <th>#</th>
    <th>游戏</th>
    <th>房间号</th>
    <th>播放码</th>
    <th>局数</th>
    <th>记录时间</th>
  </tr>
{empty name="list"}
  <tr><td colspan="6">Oh~暂无数据!</td></tr>
{else}
  {volist name="list" id="v"}
  <tr>
    <td>{$v.RecordID}</td>
    <td>[{$v.wKindID}]{$v.KindName}</td>
    <td>{$v.PrivateRoomID}</td>
    <td>{$v.PlayCodeID}</td>
    <td><a class="input">{$v.wPlayCount}</a></td>
    <td>{$v.CreateTimer}</td>
  </tr>
  {/volist}
{/empty}
</table>
</div>
<!--/列表-->

<!--内容底部-->
<div class="page-footer"><div class="btn-wrap">{$list->render()}</div></div>
<!--/内容底部-->

</form>
</body>
{/block}